import request from '@/config/axios'

export interface PatentVO {
  id: number
  major: number
  studentNumber: number
  studentName: string
  patentName: string
  patentCategory: number
  patentNumber: string
  awardDate: Date
  instructor: string
  remark: string
  status: number
  reason: string
}

// 查询学生科研专利列表
export const getPatentPage = async (params) => {
  return await request.get({ url: `/data/patent/page`, params })
}

// 查询学生科研专利详情
export const getPatent = async (id: number) => {
  return await request.get({ url: `/data/patent/get?id=` + id })
}

// 新增学生科研专利
export const createPatent = async (data: PatentVO) => {
  return await request.post({ url: `/data/patent/create`, data })
}

// 修改学生科研专利
export const updatePatent = async (data: PatentVO) => {
  return await request.put({ url: `/data/patent/update`, data })
}

// 修改学生科研专利
export const updatePatentStatus = async (data: PatentVO) => {
  return await request.put({ url: `/data/patent/updateStatus`, data })
}

// 删除学生科研专利
export const deletePatent = async (id: number) => {
  return await request.delete({ url: `/data/patent/delete?id=` + id })
}

// 导出学生科研专利 Excel
export const exportPatent = async (params) => {
  return await request.download({ url: `/data/patent/export-excel`, params })
}
